package tiantian_ssm;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import edu.gdut.tiantian.dao.CategoryDao;
import edu.gdut.tiantian.entity.Category;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:bean.xml")
public class CategoryTester {
	@Autowired
	private CategoryDao categoryDao;
	
	@Test
	public void testMap() {
		Map<String,String> condition = new HashMap<>();
		condition.put("categoryName", "s");
		condition.put("categoryId", "56");
		List<Category> list = categoryDao.findByCondition(condition);
		for(Category cate: list) {
			System.out.println(cate);  
		}
	}
}
